﻿// On change menu
$('.dd').on('change', function () {
    $('#save_menu').show();
});

function addItem() {
    $.get(urlCreateMenu, function (data) {
    });
};

function deleteMenu(id) {
    $.post(urlDeleteMenu, { id: id }, function () {
    }, "json");
}

function editMenu(id) {
    $.get(urlEditMenu, { id: id }, function (data) {
    });
    return false;
}

function saveMenu() {
    var serialized = $('.dd').nestable('serialize');

    $.post(urlSaveMenu, { list: JSON.stringify(serialized) }, function () {
        $('#save_menu').hide();
    }, "json");
}